/**
 * 
 */
(function($){
	$(document).bind("pageshow", function() {
		WL.Logger.info("PAGE BEGIN");
		chartInit();
		weatherInit();
	});
})(jQuery);



function chartInit() {	
		
	if(!!document.createElement('canvas').getContext){ //check that the canvas
        // element is supported
		var mychart = new AwesomeChart('canvas_statistic');
		mychart.title = "2013-8-23   Daily Stats Pie Chart";
		mychart.data = [1234, 2345, 3456, 4567, 5678, 6789];
		mychart.labels = ["Huangpu Area", "Xuhui Area", "Putuo Area", "Changning Area", "Hongkou Area", "Jingan Area"];
		//mychart.colors = ['#006CFF', '#FF6600', '#34A038', '#945D59', '#93BBF4', '#F493B8'];
		//mychart.randomColors = true;
		//mychart.animate = true;
		mychart.chartType = 'doughnut';
		mychart.draw();
	}
}

function weatherInit() {
	var count = Math.round(Math.random()*22) ;
	document.getElementById("#weather-img").src="../image/1.gif";
	//$("#weather-img").src = "../image/1.gif";
	//$("#weather-note").src = "Cloudy";
	document.getElementById('weather-note').innerHTML="Cloudy"
	//$("#temperature").src = "20~27 Celsius";
	document.getElementById('temperature').innerHTML="20~27 Celsius"
}
